#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int arr[N];
int n;
vector<int> fun(int x)
{
	vector<int>ans;
	for (int i = 1; i <= x / i; i++) {
		if (x % i == 0) {
			ans.push_back(i);
			if (x / i != i) {
				ans.push_back(x / i);
			}
		}
	}
	sort(ans.begin(), ans.end());
	return ans;
}
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (int i = 0; i < n; i++) {
		cout << arr[i] << " ---->:";
		vector<int>ans = fun(arr[i]);
		for (int x : ans) {
			cout << x << "  ";
		}
		cout << endl;
	}
	return 0;
}